<template>
    <div class="tabs">
      <el-tabs v-model="activeName" type="border-card">
        <el-tab-pane label="产品配方明细" name="formulamainView">
          <formulamainView ref="formulamainView" style="max-height:300px;"></formulamainView>
        </el-tab-pane>
      </el-tabs>
    </div>
  </template>
  <script>
  import processformulamainView from '@/views/dbmethod/processformula/processformulamainView.vue';
  export default {
    components: {
      'formulamainView': processformulamainView,
    },
    data() {
      return {
        activeName: 'formulamainView'
      };
    },
    methods: {
      gridRowClick(rows) {
      let FormulaTags ="";
      if(rows.length){
        rows.forEach(element => {
          console.log(JSON.stringify(element))
          if(FormulaTags==""){
            FormulaTags=element.FormulaTag;
          }else{
            FormulaTags+=","+element.FormulaTag;
          }
        });
      }else{
        FormulaTags=rows.FormulaTag;
      }
        let params = {};
        params.wheres = [{ name: "FormulaTag", value: FormulaTags,displayType: 'selectList'}];
        this.$refs.formulamainView.$refs.grid.search(params);
      },
      clearRows(){
            //主表没有数据时，清空明细数据
            this.$refs.formulamainView.$refs.table.rowData.splice(0)
          }
    }
  };
  </script>
  <style scoped>
  .tabs {
    padding: 2px 15px;
  }
  .tabs >>> .el-tabs {
    box-shadow: none;
  }
  .tabs >>> .el-tabs__content {
    padding: 0 !important;
    padding-bottom: 5px;
  }
  </style>
  